package com.youth.msmservice.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component
@PropertySource("classpath:application.properties")
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${aliyun.sms.accessKeyId}")
    private String accessKeyId;
    @Value("${aliyun.sms.accessKeySecret}")
    private String accessKeySecret;
    @Value("${aliyun.sms.endpoint}")
    private String endpoint;
    @Value("${aliyun.sms.SignName}")
    private String SignName;
    @Value("${aliyun.sms.TemplateCode}")
    private String TemplateCode;
//    @Value("${aliyun.sms.PhoneNumbers}")
//    private String PhoneNumbers;
//    @Value("${aliyun.sms.TemplateParam}")
//    private String TemplateParam;


    public static String ACCESSKEYID;
    public static String ACCESSKEYSECRET;
    public static String ENDPOINT;
    public static String SIGNNAME;
    public static String TEMPLATECODE;
//    public static String PHONENUMBERS;
//    public static String TEMPLATEPARAM;


    @Override
    public void afterPropertiesSet() throws Exception {
        ACCESSKEYID=accessKeyId;
        ACCESSKEYSECRET=accessKeySecret;
        ENDPOINT=endpoint;
        SIGNNAME=SignName;
        TEMPLATECODE=TemplateCode;
//        PHONENUMBERS=PhoneNumbers;
//        TEMPLATEPARAM=TemplateParam;
    }
}